package ar.edu.unrn.lia.model;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;

import javax.persistence.CascadeType;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.OneToMany;
import javax.persistence.OrderBy;

@Entity
public class Inquilino extends Cliente implements Serializable {

	private static final long serialVersionUID = -408064980866204911L;

	private List<Alquiler> alquileres = new ArrayList<Alquiler>(0);
	
		
	public Inquilino() {
		super();
	}

	@OneToMany(cascade = CascadeType.ALL, mappedBy = "inquilino", fetch = FetchType.LAZY)
	@OrderBy("fechaFin DESC")
	public List<Alquiler> getAlquileres() {
		return alquileres;
	}


	public void setAlquileres(List<Alquiler> alquileres) {
		this.alquileres = alquileres;
	}
	
	
	

}
